<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  	<head>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    	<title>Form Element - Button</title>
    	<script type="text/javascript">
      		var counter = 0;
      		window.onload = testButton;

      		function testButton() {
		        // document.form1.myButton.onclick = buttonClickCount;
		        document.form1.myButton.onmouseup = buttonOnMouseUp;
		        document.form1.myButton.onmousedown = buttonOnMouseDown;
      		}

      		function buttonClickCount(){
		        counter++;
		        document.form1.myButton.value = "Button clicked " + counter + " times";
	      	}

	    	function buttonOnMouseUp() {
	    	    document.form1.myButton.value = "Mouse goes up.";
	    	}
		
		    function buttonOnMouseDown() {
		        document.form1.myButton.value = "Mouse goes down.";
	      	}
    	</script>
  	</head>
  	<body>
    	<form action="" method="post" name="form1">
      		<input type="button" value="Click Me" name="myButton" />
    	</form>
  	</body>
</html>
